package main
import (
	"fmt"
)
// 接口
// 接口类型的变量可以指向任何一个实现接口声明的方法的结构体对象
type People interface {

	Speak(string) string
}

// 结构体
type Stduent struct{}

// Speak 是结构体的一个方法
func (stu Stduent) Speak(think string) (talk string) {
	if think == "bitch" {
		talk = "You are a good boy"
	} else {
		talk = "hi"
	}
	return
}

/*
# command-line-arguments
0424/0010/0010_1.go:25:6: cannot use Stduent literal (type Stduent) as type People in assignment:
	Stduent does not implement People (Speak method has pointer receiver)
 */

func main() {
	// 值类型的结构体对象只能调用值类型对应的方法
	var peo People = Stduent{}
	think := "bitch"
	fmt.Println(peo.Speak(think))
}